package com.insnow.knowshare.repository;

import com.insnow.knowshare.entity.Post;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface AdminPostRepository extends JpaRepository<Post, Long> {
    List<Post> findAllByOrderByIsTopDescIdDesc();
    List<Post> findByStatusOrderByCreatedAtDesc(Integer status);
    List<Post> findByStatusOrderByIsTopDescCreatedAtDesc(Integer status);
    Page<Post> findByStatusOrderByIsTopDescCreatedAtDesc(Integer status, Pageable pageable);
    Page<Post> findByStatusOrderByIsTopDescTopTimeDescIdDesc(Integer status, Pageable pageable);
}
